﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Imaginecup.sprite;
using imaginecup.util;

namespace Imaginecup.gameState.water.mapMan
{
    public class BackgroundBase : IBackGround
    {
        ScrollTexture scrollTextureCurrent;
        ScrollTexture scrollTextureNext;

        public BackgroundBase()
        {
            NormalSprite backgroundCurrent = new NormalSprite();
            backgroundCurrent.SetTextureName("BaseBackground");
            EntityInfo displayCurrent = new EntityInfo(-600, -360, 2000, 1200);
            scrollTextureCurrent = new ScrollTexture(backgroundCurrent, displayCurrent, 0);

            NormalSprite backgroundNext = new NormalSprite();
            backgroundNext.SetTextureName("BaseBackground");
            EntityInfo displayNext = new EntityInfo(-2600, -360, 2000, 1200);
            scrollTextureNext = new ScrollTexture(backgroundNext, displayNext, 0);
        }

        public void SetDirection(Point direction)
        {
            scrollTextureCurrent.SetDirection(direction);
            scrollTextureNext.SetDirection(direction);
        }

        public void Update(GameTime gameTime)
        {
            scrollTextureCurrent.Update(gameTime);
            scrollTextureNext.Update(gameTime);
        }

        public void Draw(GameTime gameTime, SpriteBatch spriteBatch)
        {
            scrollTextureCurrent.Draw(gameTime, spriteBatch);
            scrollTextureNext.Draw(gameTime, spriteBatch);
        }
    }
}
